<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
     <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>shopcar</title>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
    <script>
      // 设备可视宽度
      // document.documentElement.clientWidth || document.body.clientWidth
      //rem 是个相对值
      // document.documentElement.style.fontSize=document.documentElement.clientWidth||document.body.clientWidth*100/750
       change();
      function change(){
        document.documentElement.style.fontSize=(document.documentElement.clientWidth||document.body.clientWidth)*100/750+'px'
        console.log('1rem='+document.documentElement.style.fontSize);
      }

      // 窗口大小改变事件
      window.onresize=function(){
        change();
      }
    </script>
  </body>
</html>
